<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>离职员工信息</title>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link id="theme" rel="stylesheet" type="text/css"  href="<c:url value="js/jquery-easyui-1.5.4.2/themes/ui-cupertino/easyui.css"/>"/>
<link  rel="stylesheet" type="text/css" href="<c:url value="js/jquery-easyui-1.5.4.2/themes/icon.css"/>"/>
</head>
<body>
<script type="text/javascript">
	$(function(){
		var all_out_layout =function(texttitle){
			$(".add_success_ok").text(texttitle).prop(texttitle);
			$(".all_out_layout").panel("open");
			window.setInterval(function(){
				$(".all_out_layout").panel("close");
			},2000);
		}
	
		
		//模糊查询员工
		$("#search-laborturn-yj").linkbutton({
			onClick:function(){
				var mess = $("#mess-laborturn-yj").textbox("getText");
				$("#table_laborturn").datagrid('load', 'find-like-laborturnover-yj?name=' + mess);
				$("#mess-laborturn-yj").textbox("setText","")
			}
		});
		
		//创建选项卡
		var openTab = function(title, href) {
			//添加新的选项卡
			var openTab = function(title, href){
			//先判断是否已经打开
			if($("#tt").tabs("exists", title)){
			//已打开，则激活
			$("#tt").tabs("select", title);
			}else{
			//未打开，则打开
			$("#tt").tabs("add",{
			title: title,
			href: href,
			closable:true
			});
			}
			}
			openTab(title,href);
			
			var tabcount = $('#tt').tabs("tabs").length;
			var msg = '您当前打开了太多的页面，如果继续打开，会造成程序运行缓慢，无法流畅操作！您确定还要继续打开吗？';
			if(tabcount>5){
				$.messager.confirm('确认',msg,function(r){    
				    if (r){    
				    	
				    }else{	
				    	var tab = $("#tt").tabs("getSelected");
						var index = $("#tt").tabs("getTabIndex",tab);
						$("#tt").tabs("close",index);
						
				    } 
				}); 	
			}
			
		};
		//员工离职，进入到员工离职信息页面
		$(".laborturn_delete").linkbutton({
			onClick:function(){
				openTab("员工信息","to_staff");
				
			}
		});
	});
</script>
<div class="easyui-panel laborturn_message" data-options="fit:true,border:false">

<div id="toolbar_laborturn" width="400" >
			<a class="easyui-linkbutton laborturn_delete" iconCls="icon-add" plain="true">员工离职</a>
			<input id="mess-laborturn-yj"  class="easyui-textbox" data-options="iconCls:'icon-search'" style="width:200px"> 
			<a id="search-laborturn-yj" class="easyui-linkbutton" iconCls="suosou" plain="true">搜索</a>
</div>

<table id="table_laborturn" class="easyui-datagrid" data-options="
				fitColumns:true,
				fit:true,
				singleSelect:true,
				newrap:true,
				rownumbers:true,
				pagination:true,
				pageList:[5,10,15,20],
				pageSize:5,
				toolbar:'#toolbar_laborturn',
				border:false,
				url:'find-laborturnover-yj'
	">
		<thead>
			<tr>
				<th data-options="field:'LABOR_ID',checkbox:true,width:30,align:'center'"></th> 
	            <th data-options="field:'STAIN_NAME',width:50,align:'center'">员工姓名</th> 
	            <th data-options="field:'BUMEN',width:50,align:'center'">原部门</th>   
	            <th data-options="field:'ZHICHENG',width:50,align:'center'">原职称</th>   
	            <th data-options="field:'REASL_NAME',width:50,align:'center'">离职原因</th>   
	            <th data-options="field:'STAIN_DATE',width:50,align:'center',formatter:function(value,row,index){
					if(value!=null){
						var date = new Date(value);
						return date.toLocaleString();
					}
						return;
				}">入司时间</th>
	            <th data-options="field:'DIMISSION_DATE',width:50,align:'center',formatter:function(value,row,index){
					if(value!=null){
						var date = new Date(value);
						return date.toLocaleString();
					}
						return;
				}">离职时间</th> 
	             <th data-options="field:'EXECUTIVE_CHAMPION',width:50,align:'center'">批准人</th> 
	              <th data-options="field:'LABOR_REMARK',width:50,align:'center'">备注</th> 
			</tr>		
		</thead>
		
	</table>
</div>
</body>
</html>